package controller;

import model.Drug;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import service.DrugService;
import util.Result;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/drug")
public class DrugController {

    @Resource
    private DrugService service;

    @RequestMapping("/findAll.do")
    public Object findAll(){
        List<Drug> list = service.findAll();
        return new Result<>("200","",list);
    }
}
